import axios from '@/common/axios'

// 登录
export function login() {
    console.log("login --------  ")
    return axios.get(mockPre+'/edd/user/getUserInfo')
}

// 登录
export function loginOut() {
    return axios.delete('/sys/loginOut')
}

export function getSysDict() {
    return axios.post("/sysDict/selectAll")
}

/**
 * 公共
 * */
export function getSysDictList() { return axios.post(mockPre+"/public/sysDictList")}//

export function getbrigadeList() { return axios.post(mockPre+"/edd/common/getBigDeptList")}// 获取大队
export function getsquadronList(data={}) {return axios.post(mockPre+"/edd/common/getMiddleDeptList",data)}// 中队
export function getexpresswayList(data={}) { return axios.post(mockPre+"/edd/motorway/getDeptMotorWay",data)}// 高速

export function getMotorWay(data={}) { return axios.post(mockPre+"/edd/motorway/getMotorWay",data)}// 高速
export function getTimeLineInfors(id) { return axios.post(mockPre+"/edd/position/getPositionCoverMap",{id:id})}// 时间轴



/**
 * 勤务监控
 * */
/*左侧数据*/
export function getExpresswaySummary(data={}) { return axios.post(mockPre+"/edd/monitor/getMotorSpeed",data)}// 高速运行概括
export function getRealJQ(data={}) { return axios.post(mockPre+"/edd/monitor/getRealJQ",data)}// 高速运行概括
export function getExpresswayTrafficFlow(data) { return axios.post(mockPre+"/edd/monitor/getTrafficFlowChart",data)}// 交通流量曲线

// TODO
export function getSafetyWarningLine(data) { return axios.post(mockPre+"/edd/monitor/getRiskWaringChart",data)}//  安全风险预警
export function getSafetyWarninList(data) { return axios.post(mockPre+"/edd/monitor/getRiskWaringDetailList",data)}// 安全风险预警表格

export function getServiceSummary(data) { return axios.post(mockPre+"/edd/monitor/getDutyPreview",data)}// 勤务运行预览
/*右侧数据*/
export function getXunluoPingJia(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getPatrolEvaluate",data)}// 动态勤务巡逻评价
export function getEnforcementEvaluate(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getEnforcementEvaluate",data)}// 交通执法评价
export function getPatrolEvaluation(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getTroubleEvaluate",data)}// 事故处置评价
export function getBrigadeList(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getDutyTop",data)}// 勤务排名

/*巡逻评价模态框*/
export function getPatrolEvaluationDetailTable(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getSafetyAnalysis",data)}// 模态框巡逻评价table

// export function getHighRiskSection() { return axios.post(mockPre+"/edd/dynamicmonitor/getHighRiskSection")}// 高风险时段时空分布高速查询

export function getPatrolEvaluationDetailskfb(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getHighRiskAnalysis ",data)}// 高风险时段时空分布

export function getPatrolEvaluationDetailgfxfgl(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getHighRiskSectionProtalCoverRate",data)}// 高风险路段巡逻覆盖率
export function getHighRiskRoadSectionCategory(data) { return axios.post(mockPre+"/edd/dynamicmonitor/getHighRiskSectionProtalTime",data)}// 高风险路段巡逻时长占比


/**
 * 应急值守
 * */
// 今日警情
export function getTodyPoliceStatus(data) { return axios.post(mockPre+"/edd/emergency/getPoliceSituationPreview",data) }
// 实时警情
export function getRealTimePoliceInformationList(body) {
    body.pageSize = 10;
    return axios.post(mockPre+"/edd/emergency/getRealTimePoliceInfoPage",body)
}
export function getRealTimePoliceInformationDetail(id) {
    return axios.post(mockPre+"/edd/emergency/getRealTimePoliceInfo", {id: id})
}
export function getWayByLikeName(name,type) {
    return axios.post(mockPre+"/edd/mappmonitor/getByLikeName", {name: name,type:type})
}

// 风险预警
// TODO
export function getRiskWarningList(body) {
    body.pageSize = 10;
    return axios.post(mockPre+"/edd/emergency/getRiskWarningPage", body)
}
// TODO
//散列图
export function getFaceWarningScatter() { return axios.post(mockPre+"/edd/monitor/getFaceWarningScatter")}
// 交通管制
export function getTrafficControlList(body) {
    body.pageSize = 10;
    return axios.post(mockPre+"/edd/emergency/getTrafficControllList", body)
}
export function ignoreTrafficControl(id) {
    return axios.post(mockPre+"/edd/emergency/ignoreTrafficControl", {id:id})
}



/**
 * 岗位安排
 * */
// 岗位安排概况
export function getEmergencyDutySurveyList(data) { return axios.post(mockPre+"/edd/position/getPostDeploy", data)}
// 岗位安排概况
export function getEmergencyDutyList(data) { return axios.post(mockPre+"/edd/position/getPostDeployRecord",data)}
export function exportEmergencyDutyList(data) { return axios.post(mockPre+"/edd/position/getExcelData",data)}
export function addPosition(data) { return axios.post(mockPre+"/edd/position/addPosition",data)} //添加岗位安排详情
export function updatePostion(data) { return axios.post(mockPre+"/edd/position/updatePostion",data)} //修改岗位安排详情
export function deletePosition(id) { return axios.post(mockPre+"/edd/position/deletePosition",{positionId: id})} //删除布岗详情
export function getPositionDetail(id) { return axios.post(mockPre+"/edd/position/getPositionDetail",{positionId: id})} //删除布岗详情
export function submitPostion(data) { return axios.post(mockPre+"/edd/position/submitPostion",data)} //提交布岗
export function copyPostDeploy(data) { return axios.post(mockPre+"/edd/position/copyPostDeploy",data)} //岗位历史复制
export function saveDayPostion(data) { return axios.post(mockPre+"/edd/position/saveDayPostion",data)} //岗位历史复制

export function getLawEnforcementStation(data) { return axios.post(mockPre+"/edd/position/getLawEnforcementStation",data)} //执法站获取
export function getLawRadius() { return axios.post(mockPre+"/edd/position/getLawRadius")} //执法站半径获取
export function getIsDeploy(data) { return axios.post(mockPre+"/edd/position/getIsDeploy",data)} //是否部署
export function getDeptGX() { return axios.post(mockPre+"/edd/position/getDeptGX")} //是否部署

// 时空风险监控
export function getSecurityRiskAnalysisList(data) { return axios.post(mockPre+"/edd/position/getSafetyAnalysis",data) }
export function getPoliceSecurityRiskAnalysisList(data) { return axios.post(mockPre+"/edd/police/getSafetyAnalysis",data) }
export function getCoverageRate(data) { return axios.post(mockPre+"/edd/position/getCoverageRate",data) } ////时空覆盖率
export function getPoliceCoverageRate(data) { return axios.post(mockPre+"/edd/police/getCoverageRate",data) } ////时空覆盖率

/**
 * 警力安排
 * */
export function getPoliceDutyList(data) {return axios.post(mockPre+"/edd/police/getPoliceDeploy",data)} //警力部署信息
export function getPolicList(data) {return axios.post(mockPre+"/edd/police/getPolicList",data)}  //获取时间段的警力人员
export function getPoliceCar(data) {return axios.post(mockPre+"/edd/police/getPoliceCar",data)}  //警车查询
export function addPositionPolice(data) {return axios.post(mockPre+"/edd/police/addPositionPolice",data)}  //警员分配
export function updatePositionPolice(data) {return axios.post(mockPre+"/edd/police/updatePositionPolice",data)}  //警员修改
export function deletePositionPolice(id) {return axios.post(mockPre+"/edd/police/deletePositionPolice",{id:id})}  //删除警员





/**
 * 地图
 * */
export function getGsPoints() {return axios.post(mockPre+"/edd/mappmonitor/getExpresswayRangeList",)} //高速

export function geTrafficSituation(data) {return axios.post(mockPre+"/edd/mappmonitor/geTrafficSituation",data)} //路况
export function getTrafficAccident(data) {return axios.post(mockPre+"/edd/mappmonitor/getTrafficAccident",data)} //事故
export function getPoliceStrength(data) {return axios.post(mockPre+"/edd/mappmonitor/getPoliceStrength",data)} //警力
export function getPoliceTrack(thirdsyscode) {return axios.post(mockPre+"/edd/mappmonitor/getPoliceTrack",{thirdsyscode:thirdsyscode})} //警员轨迹
// 新增
export function getConstructionList(data) {return axios.post(mockPre+"/edd/mappmonitor/getConstructionList",data)} //施工
export function getVideoList(data) { //视频
    let url = "";
    if(!mockPre){
        url = HiMapConfig.HOSTNAME+'mapindex/getMonitor?clulevel=0.02&bbox=119.89792,35.90262,120.20454,36.16182&devicetypes=13'
    }else{
        url = mockPre+"/edd/mappmonitor/getVideoList"
    }
    return axios.post(url,data)
}
export function getFogDetection(data) { //雾区检测器
    let url = "";
    if(!mockPre){
        url = HiMapConfig.HOSTNAME+'mapindex/getMonitor?clulevel=0.02&bbox=119.9379,36.10083,120.32248,36.35939&devicetypes=36'
    }else{
        url = mockPre+"/edd/mappmonitor/getFogDetectionList"
    }
    return axios.post(url,data)
}
export function getFogCollision(data) {return axios.post(mockPre+"/edd/mappmonitor/getFogCollisionList",data)} //雾区防撞
export function getMeteorologicalDetection(data) {  //气象检测器
    let url = "";
    if(!mockPre){
        url = HiMapConfig.HOSTNAME+'mapindex/getMonitor?clulevel=0.02&bbox=119.9379,36.10083,120.32248,36.35939&devicetypes=34'
    }else{
        url = mockPre+"/edd/mappmonitor/getMeteorologicalDetectionList"
    }
    return axios.post(url,data)}
export function getGuidanceScreen(data) { //诱导屏
    let url = "";
    if(!mockPre){
        url = HiMapConfig.HOSTNAME+'mapindex/getMonitor?clulevel=0.008&bbox=119.94701,35.99614,120.1391,36.12588&devicetypes=10'
    }else{
        url = mockPre+"/edd/mappmonitor/getGuidanceScreenList"
    }
    return axios.post(url,data)
}
export function getShouting(data) {  //喊话设备
    let url = "";
    if(!mockPre){
        url = HiMapConfig.HOSTNAME+'mapindex/getMonitor?clulevel=0.02&bbox=119.9379,36.10083,120.32248,36.35939&devicetypes=34,35'
    }else{
        url = mockPre+"/edd/mappmonitor/getShoutingList"
    }
    return axios.post(url,data)
}
export function getUrbanJurisdiction() {return axios.post(mockPre+"/ddm/mappmonitor/getUrbanJurisdiction",)} //辖区


export function getTollGate(data) {return axios.post(mockPre+"/edd/mappmonitor/getTollGate",data)} //收费站，服务区
export function getSlipperySection(data) {return axios.post(mockPre+"/edd/mappmonitor/getSlipperySection",data)} //易滑路段 长下坡
export function getAccidentBlack(data) {return axios.post(mockPre+"/edd/mappmonitor/getAccidentBlack",data)} //事故黑点
// TODO
export function getSafetyWarningWay(data) {return axios.post(mockPre+"/edd/mappmonitor/getSafetyWarning",data)} //安全预警


export function getRordBayonet(data) {return axios.post(mockPre+"/edd/mappmonitor/getRordBayonet",data)} //卡口




export function pileToCrd(pile,dldm){
    // const url =
    return axios.get(HiMapConfig.HOSTNAME+'query/convertPileToCrd',{params:{pile:pile,dldm:dldm}})
}

